#include "optical_flow.h"
#include "tracker.h"

void OpticalFlowSingleLevel(const Mat &img1,
                            const Mat &img2,
                            const vector<KeyPoint> &kp1,
                            vector<KeyPoint> &kp2,
                            vector<bool> &success,
                            bool inverse, bool has_initial)
{
    kp2.resize(kp1.size());
    success.resize(kp1.size());
    OpticalFlowTracker tracker(img1, img2, kp1, kp2, success, inverse, has_initial);
    parallel_for_(Range(0, kp1.size()),
                  std::bind(&OpticalFlowTracker::calculateOpticalFlow, &tracker, placeholders::_1));
}
